<?php

/*
 * Created on 2010
 * Link for job@phpyun.com
 * This PHPYun.Rencai System Powered by PHPYun.com
 */
$js_def = 4; //?????
$del	= (int) $_GET[del];
$up		= (int) $_GET[up];
//print_r($_POST);

if ($del) {
	$obj->DB_delete_all("company_job", "`id`='$del' and `uid`='$cuid'");
	$obj->ACT_msg($_SERVER['HTTP_REFERER'],"??????");
}
if($up){
	$obj->DB_update_all("company_job","`lastupdate`='".mktime()."'", "`id`='$up' and `uid`='$cuid'");
	$obj->ACT_msg("commanage.php?action=job");
}

$count = $obj->DB_select_num("company_job", "`uid`='$cuid'", "id");
$wcount = $obj->DB_select_num("company_job","`state`='".$_GET[w]."'");
$pages = new PageClass($count, 10, $_GET['page'], 'commanage.php?action=job&page={page}');


if($_GET[w]==1){
$jobedate=$obj->DB_select_all("company_job","`edate`<'".mktime()."' and `uid`='$cuid'");
foreach($jobedate as $v){
$obj->DB_update_all("company_job", "`state`='2'", "`id`='$v[id]'");
}
}


$sel_display = "`id`, `uid`, `name`, `jobid`,`xuanshang`, `sdate`, `edate`, `state`, `lastupdate`,`jobhits`";
$row_company_job = $obj->DB_select_all("company_job", "`uid`='$cuid' and `state`='".$_GET[w]."' order by `lastupdate` desc limit " . $pages->page_limit . "," . $pages->myde_size, $sel_display);


$job_id="`job_id`=".$row_company_job[0][id];
//$userid_job = $obj->DB_select_all("userid_job","$job_id");
//print_r($userid_job);
$page_write = $pages->myde_write();

//print_r($row_company_job);
?>
